package cn.tsingyu.swarm.common;

import org.beetl.core.GroupTemplate;
import org.beetl.ext.jfinal.BeetlRenderFactory;

import cn.tsingyu.swarm.web.controller.IndexController;

import com.jfinal.config.Constants;
import com.jfinal.config.Handlers;
import com.jfinal.config.Interceptors;
import com.jfinal.config.JFinalConfig;
import com.jfinal.config.Plugins;
import com.jfinal.config.Routes;

/**
 * 
 * @author 土龙  heshilong2005@163.com
 * 2015年11月16日 下午3:21:03
 */
public class Config extends JFinalConfig{

	@Override
	public void configConstant(Constants me) {
		//加载配置文件，然后可用getProperty(...)取值
		loadPropertyFile("config.properties");
		me.setDevMode(getPropertyToBoolean("devMode",false));
		me.setMainRenderFactory(new BeetlRenderFactory());
		GroupTemplate gt = BeetlRenderFactory.groupTemplate;
		
	}

	@Override
	public void configRoute(Routes me) {
		me.add("/",IndexController.class,"/index");
		
	}

	@Override
	public void configPlugin(Plugins me) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void configInterceptor(Interceptors me) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void configHandler(Handlers me) {
		// TODO Auto-generated method stub
		
	}
	
}
